﻿using Clover.BaseAuth;
using Clover.Demo.App_Start;
using Clover.Demo.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Filters;
using System.Web.Routing;

namespace Clover.Demo.Controllers
{
    public class HomeController : Controller
    {
        [PermissionFilter("/Home/Index/")]
        [Permission(PermissionConfig.Admin, PermissionConfig.View,PermissionConfig.Test, PermissionConfig.User)]
        public ActionResult IndexView()
        {
            return Content(DefaultCurrentIdentity.Default.GetIdentity());
        }

        [AllowAnonymous]
        public ActionResult AboutView()
        {
            DefaultCurrentIdentity.Default.SetIdentity(Request["user"]);

            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}